package java56_6;

public class TestPet2 {

	public static void main(String[] args) {
		// Pet p1 = new Pet("眼镜蛇", 3, "公");
		// System.out.println(p1);
		System.out.println(">>>>>>>>>>>>>");
		Pet p = new Dog("杰克", 3, "公", "斗牛犬");
		// Pet p = new Penuin("杰克", 3, "公");
		System.out.println(p);
		p.print();
		p.shout();
		Dog d = (Dog) p;
		// 重写的方法调用子类的，父类中没有的不能调用
		d.bite(new Mouse("小灰"));

	}

}
